<template>
  <div>
    <h1 style="font-size: 28px">日志详情</h1>
    <div>
      <a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 14 }">
        <a-form-item label="模块">
          <a-input :value="module" disabled/>
        </a-form-item>
        <a-form-item label="操作">
          <a-input :value="action" disabled/>
        </a-form-item>
        <a-form-item label="IP">
          <a-input :value="ip" disabled/>
        </a-form-item>
        <a-form-item label="URL">
          <a-input :value="url" disabled/>
        </a-form-item>
        <a-form-item label="结果">
          <a-input :value="result" disabled/>
        </a-form-item>
        <a-form-item label="创建人">
          <a-input :value="creator_name" disabled/>
        </a-form-item>
        <a-form-item label="创建时间">
          <a-input :value="create_time" disabled/>
        </a-form-item>
        <a-form-item :wrapper-col="{ span: 14, offset: 4 }">
          <a-button style="width: 140px;" @click="onBack">返回</a-button>
        </a-form-item>
      </a-form>
    </div>
  </div>
</template>
<script lang="ts">
  import {defineComponent, reactive, toRefs} from 'vue';

  export default defineComponent({
    name: 'LogDetail',
    props: {
      item: {
        type: Object,
        default: null,
      },
      viewType: {
        type: String,
        default: null,
      }
    },
    setup(props, {emit}) {

      const data = reactive({
        log_id: props.item.log_id,
        module: props.item.module,
        action: props.item.action,
        ip: props.item.ip,
        url: props.item.url,
        result: props.item.result,
        create_time: props.item.create_time,
        creator_name: props.item.creator_name,
      });

      const onBack = () => {
        emit("my-emit", 'Cancel');
      }

      return {
        ...toRefs(data),
        onBack,
      };
    }
  });

</script>

<style scoped>

</style>
